package com.imooc.product.exception;

import com.imooc.product.enums.ResultEnum;
import lombok.Data;

/**
 * Description: 商品异常类
 * Project: product <br />
 * ClassName: ProductException <br />
 * Copyright: Copyright (c) 2018 deshang<br />
 *
 * @author Wang Shaopeng
 * @date 2018/12/26 22:31
 * @modifier
 * @modifyContent
 */
@Data
public class ProductException extends RuntimeException {

    private Integer code;

    private ProductException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public ProductException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

}
